package com.util.format;

//import com.alibaba.fastjson.JSONObject;

import net.sf.json.JSONObject;

import java.util.HashMap;

/**
 * Created by reeveslee on 16/5/5.
 */
public class ReevesMap extends HashMap<String, Object> {
    int code;
    String info;
//    JSONObject content;

    public ReevesMap() {
        super();
        code = 200;
        info = "";
//        content = JSONObject.parseObject("{}");
        super.put("code", code);
        super.put("info", info);
//        super.put("content", content);
    }

    public void setCode(int code) {
        this.code = code;
        super.replace("code", code);
    }

    public void setInfo(String info) {
        this.info = info;
        super.replace("info", info);
    }

    public String toJsonString() {
        return JSONObject.fromObject(this).toString();
    }

//    public void setContent(JSONObject content) {
//        this.content = content;
//        super.replace("content", content);
//    }
}
